var Ajuda = Ext
		.extend(
				Ext.Window,
				{
					$depends : [ strPastaUx + "Ext.ux.tree.TreeFilterX",
							strPastaUx + "Ext.ux.tree.RemoteTreePanel" ],
					layout : "border",
					title : "Ajuda",
					height : 400,
					width : 610,
					iconCls : "silk-question",
					constrainHeader : true,
					closeAction : "hide",
					border : false,
					resizable : false,
					setConteudo : function(a) {
						this.conteudo = a
					},
					initComponent : function() {
						this.menuAjuda = new Ext.ux.tree.RemoteTreePanel( {
							id : "menuAjuda",
							region : "west",
							width : 148,
							autoScroll : true,
							animate : true,
							containerScroll : true,
							dataUrl : "help/menuAjuda.json",
							rootVisible : false,
							root : {
								nodeType : "async"
							},
							minSize : 148,
							maxSize : 300,
							split : true,
							editable : false,
							contextMenu : false,
							listeners : {
								scope : this,
								click : this.onNodeClick
							},
							tbar : [ {
								xtype : "textfield",
								width : 145,
								emptyText : "Procurar",
								enableKeyEvents : true,
								listeners : {
									scope : this,
									keyup : {
										buffer : 150,
										fn : function(c, b) {
											var d = c.getRawValue();
											var a = new RegExp(".*" + d + ".*",
													"i");
											this.menuAjuda.filter.clear();
											this.menuAjuda.filter.filter(a,
													"text")
										}
									}
								}
							} ]
						});
						this.menuAjuda.filter = new Ext.ux.tree.TreeFilterX(
								this.menuAjuda);
						new Ext.tree.TreeSorter(this.menuAjuda, {
							folderSort : true
						});
						this.tabConteudoAjuda = new Ext.TabPanel(
								{
									region : "center",
									enableTabScroll : true,
									activeTab : 0,
									defaults : {
										closable : true
									},
									items : [ {
										autoScroll : true,
										title : "Ajuda",
										html : "<table width='420' border='0' class='titulo'><tr><td width='355' height='140' valign='middle'><h1>Ajuda e Suporte do SIAD</h1><p>Para obter ajuda, navegue pelo menu lateral.</p></td><td width='150' align='right' valign='top'><span style='height:300px'><img src='img/question.png' align='right'></span></td></tr><tr height='175' valign='bottom'><td>&nbsp;</td><td><span style='height:300px'><img src='img/ieadc.png' width='139' height='45' align='right'></span></td></tr></table>",
										bodyStyle : "padding:10px;",
										iconCls : "silk-question",
										closable : false
									} ]
								});
						this.storeModulosUsuario = new Ext.data.JsonStore(
								{
									autoLoad : true,
									url : "include/administracao/moduloAction.php?action=listarModulosUsuario",
									root : "rows",
									fields : [ {
										name : "id_fonte"
									} ],
									listeners : {
										scope : this,
										load : function(b) {
											var a = this.menuAjuda
													.getRootNode();
											b.data
													.each(function(c) {
														var d = c
																.get("id_fonte")
																+ "Help";
														if (a
																.findChild(
																		"id", d) !== null) {
															a
																	.findChild(
																			"id",
																			d).ui
																	.show()
														}
													});
											this.menuAjuda
													.getRootNode()
													.eachChild(
															function(c) {
																if (c == undefined
																		|| c == null) {
																} else {
																	if (c.hidden === true) {
																		c
																				.remove(true)
																	}
																}
															})
										}
									}
								});
						this.manager = new Ext.WindowGroup();
						this.manager.zseed = 31000;
						Ext.apply(this, {
							items : [ this.menuAjuda, this.tabConteudoAjuda ],
							manager : this.manager
						});
						Ajuda.superclass.initComponent.call(this)
					},
					onNodeClick : function(d) {
						if (d.attributes.cls === "folder") {
							return false
						}
						var a = d.text;
						var c = d.id;
						var b = this.tabConteudoAjuda.items.find(function(e) {
							return e.title === a
						});
						if (!b) {
							b = this.tabConteudoAjuda.add( {
								title : a,
								iconCls : d.attributes.iconCls,
								bodyStyle : "padding:5px;",
								autoScroll : true,
								autoLoad : {
									url : "help/" + c + ".html"
								}
							})
						}
						this.tabConteudoAjuda.activate(b)
					}
				});